﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using WPFServices.ViewModels.DomainViewModel.Productinfo;

namespace WPFServices.Views.DomainViews.Productinfo
{
    /// <summary>
    /// ProductView.xaml 的交互逻辑
    /// </summary>
    public partial class ProductViewWindow : Window
    {
        public ProductViewWindow()
        {
            InitializeComponent();
            var viewModel = new ProductViewModel();
            this.DataContext = viewModel;

            // 订阅ViewModel的关闭窗口事件
            viewModel.CloseWindow += (result) =>
            {
                DialogResult = result;
                Close();
            };
        }
    }
}
